//2009/08/21 11:16:13
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class AdditionCycles
{
public:
    int cycleLength(int n)
    {
		int ncase = 0;
		int key = n;
		while(1)
		{
			cout << "N: " << n << endl;
			int a = n/10;
			int b = n%10;
			a += b;
			n = a%10 + b*10;
			if(key == n) break;
			ncase ++;
		}
		return ncase+1;
    }
};
